using System.Data;
using Net.Share;
using Net.Table;

public partial class TestDataConfig : IEntityDataConfig
{
    public int ID { get; set; }

    /// <summary>场景名称</summary>
    public System.Boolean[] Name { get; set; }

    /// <summary>byte数组测试</summary>
    public System.Byte[] Bytes { get; set; }

    /// <summary></summary>
    public System.String[] Strings { get; set; }

    /// <summary></summary>
    public System.Collections.Generic.List<System.Byte> ByteList { get; set; }

    /// <summary></summary>
    public System.Collections.Generic.List<System.String> StrList { get; set; }

    /// <summary></summary>
    public System.DateTime[] TimeArray { get; set; }

    /// <summary></summary>
    public System.Collections.Generic.List<System.DateTime> TimeList { get; set; }



    public object this[int index]
    {
        get
        {
            switch (index)
            {
                case 0: return Name;
                case 1: return Bytes;
                case 2: return Strings;
                case 3: return ByteList;
                case 4: return StrList;
                case 5: return TimeArray;
                case 6: return TimeList;

                default: return null;
            }
        }
        set
        {
            switch (index)
            {
                case 0: Name = (System.Boolean[])value; break;
                case 1: Bytes = (System.Byte[])value; break;
                case 2: Strings = (System.String[])value; break;
                case 3: ByteList = (System.Collections.Generic.List<System.Byte>)value; break;
                case 4: StrList = (System.Collections.Generic.List<System.String>)value; break;
                case 5: TimeArray = (System.DateTime[])value; break;
                case 6: TimeList = (System.Collections.Generic.List<System.DateTime>)value; break;

            }
        }
    }

    public object this[string columnName] 
    {
        get
        {
            switch (columnName)
            {
                case "Name": return Name;
                case "Bytes": return Bytes;
                case "Strings": return Strings;
                case "ByteList": return ByteList;
                case "StrList": return StrList;
                case "TimeArray": return TimeArray;
                case "TimeList": return TimeList;

                default: return null;
            }
        }
        set
        {
            switch (columnName)
            {
                case "Name": Name = (System.Boolean[])value; break;
                case "Bytes": Bytes = (System.Byte[])value; break;
                case "Strings": Strings = (System.String[])value; break;
                case "ByteList": ByteList = (System.Collections.Generic.List<System.Byte>)value; break;
                case "StrList": StrList = (System.Collections.Generic.List<System.String>)value; break;
                case "TimeArray": TimeArray = (System.DateTime[])value; break;
                case "TimeList": TimeList = (System.Collections.Generic.List<System.DateTime>)value; break;

            }
        }
    }

    public void Init(DataRow row)
    {
        ID = ObjectConverter.AsInt(row["ID"]);
        Name = TypeSolver<System.Boolean[]>.Solver.As(row["Name"]);
        Bytes = TypeSolver<System.Byte[]>.Solver.As(row["Bytes"]);
        Strings = TypeSolver<System.String[]>.Solver.As(row["Strings"]);
        ByteList = TypeSolver<System.Collections.Generic.List<System.Byte>>.Solver.As(row["ByteList"]);
        StrList = TypeSolver<System.Collections.Generic.List<System.String>>.Solver.As(row["StrList"]);
        TimeArray = TypeSolver<System.DateTime[]>.Solver.As(row["TimeArray"]);
        TimeList = TypeSolver<System.Collections.Generic.List<System.DateTime>>.Solver.As(row["TimeList"]);

    }
}